package cn.sdormitory.controller;

import cn.sdormitory.attendance.entity.AttendanceRules;
import cn.sdormitory.common.api.CommonResult;
import cn.sdormitory.service.AppAttendanceRulesService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author: lx
 * @date: 2023/9/8 15:23
 * @description:
 */
@RestController
@RequestMapping("/app/attendance/rules")
@Api("班级考勤规则")
public class AppAttendanceRulesController {

    @Autowired
    AppAttendanceRulesService appAttendanceRulesService;

    @GetMapping("/findAllAttendanceRules")
    public CommonResult findAllAttendanceRules(){
        List<AttendanceRules> list = appAttendanceRulesService.findAllAttendanceRules();
        if(list != null || list.size() > 0){
            return CommonResult.success(list);
        }else {
            return CommonResult.failed("未能查到数据");
        }
    }
}
